package cn.gjculture.shopping.api.dao;

import cn.gjculture.shopping.api.entity.Art;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ArtDao {

    @Insert("insert into art(goodsId,goodsName,artTypeId,artistId,recommendIndex,goodsIntroduction,goodsDesc,goodsNo," +
            "primeCost,`index`,price,discountPrice,discount,superDiscount,insertTime,updateTime,`status`,recommended,commodityType) " +
            "values(#{goodsId},#{goodsName},#{artTypeId},#{artistId},#{recommendIndex},#{goodsIntroduction},#{goodsDesc}" +
            ",#{goodsNo},#{primeCost},#{index},#{price},#{discountPrice},#{discount},#{superDiscount},#{insertTime},#{updateTime},#{status},#{recommended},#{commodityType})")
    int insert(Art art);

    @Select("select * from art")
    List<Art> query();

    @Select("select * from art where goodsId=#{artId}")
    Art queryById(String artId);

    @Delete("delete from art where goodsId=#{id}")
    int delete(String id);
}
